<%@page contentType="text/html;charset=UTF-8"%>
<%@include file="../common.jsp"%>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Project Infor</title>
	<link href="${ctx}/resources/css/project/project.css" rel="stylesheet">
	<link href="${ctx}/resources/css/bootstrap/bootstrap.min.css" rel="stylesheet">
	<link href="${ctx}/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
	
	<script type="text/javascript" src="${ctx}/resources/js/highcharts/jquery-1.8.2.min.js"></script>
	<c:set var="active" value="commits"/>
    <%@include file="../common/head.jsp"%>
</head>
<body>
	<div class="container">
        <div class="row bg-fff">

            <ul class="ant-menu ant-menu-horizontal  ant-menu-light ant-menu-root">


                <li class="<c:if test="${active=='jobs'}">ant-menu-item-selected</c:if> ant-menu-item" >
                    <a href="${ctx}/project/detail?id=${project.id}">
                        <span> Jobs </span>
                    </a>
                </li>
                <li class="<c:if test = "${active == 'commits'}">ant-menu-item-selected</c:if> ant-menu-item" >
                    <a href="${ctx}/project/commits?id=${project.id}">
                        <span> Commits <span class="badge">${project.totalCommitsCount}</span></span>
                    </a>
                </li>
            </ul>



            <div class="col-md-12 pb10">
				<table class="builds">
					<thead>
						<tr>
						<th>#</th>
						<th>Status</th>
						<th>Commit</th>
						<th>Message</th>
						<th>Opt</th>
						<th>Branch</th>
						<th>User</th>
						<th>Finished at</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${list}" var="commit" varStatus="commitStatus">						
						<tr class="alert alert-success build">
							<td class="status">	${commitStatus.index + 1}	</td>
							<c:choose>
								<c:when test="${commit.status==0}">
									<td class="status"><span class="label label-success">success&nbsp;</span></td>
								</c:when>
								<c:otherwise>
									<td class="status"><span class="label label-danger">Error&nbsp;</span></td>
								</c:otherwise>
							</c:choose>
							<td class="build-link">	<a href="${commit.url}"><strong> ${fn:substring(commit.commitName, 0, 10)}</strong>	</a></td>
							<td class="build-message">	<span>${commit.message}</span>	</td>
							<td class="build-link">	<a href="${ctx}/project/jobs?id=${commit.projId}&commitName=${commit.commitName}">job</a>	</td>
							<td class="build-branch">	<span>	<a href="#">${commit.branch}</a>	</span>	</td>
							<td class="duration">	<span>	<a href="mailto:${commit.email}">${commit.userName}</a>	</span>	</td>
							<td class="timestamp">	<span><fmt:formatDate value="${commit.createAt}" type="both" pattern="yyyy-MM-dd HH:mm:ss"/></span>	</td>
						</tr>
						</c:forEach>
					</tbody>
				</table>
				<!--ul class="pagination">
					<li class="active">	<a href="#">1</a>	</li>
					<li class=""><a href="/projects/6?page=2" rel="next">2</a>	</li>
					<li class="">	<a href="/projects/6?page=3">3</a>	</li>
					<li class="">	<a href="/projects/6?page=4">4</a>	</li>
					<li class="">	<a href="/projects/6?page=5">5</a>	</li>
					<li class="disabled">	<a href="#">…</a>	</li>
					<li>	<a href="/projects/6?page=2" rel="next">Next ›</a>	</li>
					<li>	<a href="/projects/6?page=9">Last »</a>	</li>
				</ul-->
			</div>
		</div>
	</div>
</body>
</html>
